package com.cbianc.structure.adapter.object_adapter

import com.cbianc.structure.adapter.class_adapter.Adaptee
import com.cbianc.structure.adapter.Target

class ObjectAdapter(private val adaptee: Adaptee) : Target {
    override fun request() {
        adaptee.specificRequest()
    }
}

//客户端代码
object ObjectAdapterTest {
    @JvmStatic
    fun main(args: Array<String>) {
        println("对象适配器模式测试：")
        val adaptee = Adaptee()
        val target: Target = ObjectAdapter(adaptee)
        target.request()
    }
}